﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head runat="server">
    <title>温室信息系统</title>

    <script src="../../Content/jquery-1.7.1.min.js"></script>
    <link href="../../Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <script src="../../Content/bootstrap/js/bootstrap.min.js"></script>
    <style type="text/css">
        body {
            padding-top: 20%;
            /*background: #C0DEED;*/
            /*background-attachment: fixed;*/
        }

        .div {
            margin: auto;
            max-width: 800px;
            background: #C0DEED;
            /*background: url('/content/10000.png') no-repeat left top;*/
        }
    </style>
</head>
<body id="body">
    <div class="div">
        <div class="row" style="height: 40px">
        </div>
        <div class="row">
            <div class="span6">
                <img src="/Content/10000.png" style="padding-left: 25px;" />
            </div>
            <div class="span3">
                <div class="row">
                    <div class="span3">
                        <input type="text" class="input-block-level" id="code" name="code" placeholder="用户名" />
                    </div>
                </div>
                <div class="row">
                    <div class="span3">
                        <input type="password" class="input-block-level" id="cpassword" name="cpassword" placeholder="密码" />
                    </div>
                    <div class="row">
                        <div class="span2 offset2">
                            <button type="button" class="btn btn-primary  btn-large" id="btnSubmit" name="btnSubmit">登陆</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="icp" style="text-align: center">
            <a href="http://www.miibeian.gov.cn" target="_blank">
                <input type="button" value="京ICP证12037404号" class="btn btn-link" />
            </a>
        </div>

    </div>
</body>
<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {
            var datas = $("input", $("#body")).serialize();
            $.post("/login/login", datas)
             .success(function (result) {
                 if (result.status == "success") {
                     window.location.href = result.href;
                 }
                 else {
                     alert(result.msg);
                 }
             })
             .error(function (result) {
                 alert(result.statusText);
             })
        });
    });
</script>
</html>
